package com.dcd.service.impl;

import com.dcd.mapper.Collection_informationMapper;
import com.dcd.pojo.Collection_information;
import com.dcd.service.Collection_informationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class Collection_informationServiceImpl implements Collection_informationService {

    @Autowired(required = false)
    private Collection_informationMapper cim;

    /**
     * 根据用户登入id查询咨询收藏
     * @param user_id 用户登入id
     * @return
     */
    @Override
    public List<Collection_information> select_collection_informationList(int user_id) {
        return cim.select_collection_informationList(user_id);
    }

    /**
     * 添加资讯收藏
     * @param collection_information 收藏表对象
     * @return
     */
    @Override
    public boolean add_collection_information(Collection_information collection_information) {
        return cim.add_collection_information(collection_information)==1;
    }

    /**
     * 取消收藏
     * @param collection_information 收藏表对象
     * @return
     */
    @Override
    public boolean delete_collection_information(Collection_information collection_information) {
        return cim.delete_collection_information(collection_information)>0;
    }

    @Override
    public boolean select_user_collection_infomation(Collection_information collection_information) {
        return cim.select_user_collection_infomation(collection_information)==1;
    }
}
